package com.ruoyi.shebei.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shebei.mapper.LedgerMapper;
import com.ruoyi.shebei.domain.Ledger;
import com.ruoyi.shebei.service.ILedgerService;

/**
 * 设备台账Service业务层处理
 * 
 * @author admin
 * @date 2024-08-02
 */
@Service
public class LedgerServiceImpl implements ILedgerService 
{
    @Autowired
    private LedgerMapper ledgerMapper;

    /**
     * 查询设备台账
     * 
     * @param ledgerId 设备台账主键
     * @return 设备台账
     */
    @Override
    public Ledger selectLedgerByLedgerId(Long ledgerId)
    {
        return ledgerMapper.selectLedgerByLedgerId(ledgerId);
    }

    /**
     * 查询设备台账列表
     * 
     * @param ledger 设备台账
     * @return 设备台账
     */
    @Override
    public List<Ledger> selectLedgerList(Ledger ledger)
    {
        return ledgerMapper.selectLedgerList(ledger);
    }

    /**
     * 新增设备台账
     * 
     * @param ledger 设备台账
     * @return 结果
     */
    @Override
    public int insertLedger(Ledger ledger)
    {
        ledger.setCreateTime(DateUtils.getNowDate());
        return ledgerMapper.insertLedger(ledger);
    }

    /**
     * 修改设备台账
     * 
     * @param ledger 设备台账
     * @return 结果
     */
    @Override
    public int updateLedger(Ledger ledger)
    {
        return ledgerMapper.updateLedger(ledger);
    }

    /**
     * 批量删除设备台账
     * 
     * @param ledgerIds 需要删除的设备台账主键
     * @return 结果
     */
    @Override
    public int deleteLedgerByLedgerIds(Long[] ledgerIds)
    {
        return ledgerMapper.deleteLedgerByLedgerIds(ledgerIds);
    }

    /**
     * 删除设备台账信息
     * 
     * @param ledgerId 设备台账主键
     * @return 结果
     */
    @Override
    public int deleteLedgerByLedgerId(Long ledgerId)
    {
        return ledgerMapper.deleteLedgerByLedgerId(ledgerId);
    }
}
